package org.extreme.pivot.grid;

import org.apache.pivot.wtk.Bounds;

public class Grid extends BaseGrid {
	GridSelection gridSelection = new GridSelection(this);
	
	public Grid() {
		this(null);
	}
	
	public Grid(XSheetPane xSheetPane) {
		super(xSheetPane);
		setSkin(new GridSkin());
	}
	
	public int getRowAt(int y) {
		Grid.Skin skin = (Grid.Skin)getSkin();
		return skin.getRowAt(y);
	}
	
    public int getColAt(int x) {
    	Grid.Skin skin = (Grid.Skin)getSkin();
		return skin.getColAt(x);
    }
    
    public Bounds getCellBounds(int col, int row) {
    	Grid.Skin skin = (Grid.Skin)getSkin();
		return skin.getCellBounds(col, row);
    }

	public interface Skin {
        public int getRowAt(int y);
        public int getColAt(int x);
        public Bounds getCellBounds(int col, int row);
    }
}
